<!DOCTYPE html>
<head>
    {% if title %}
    <title>{{title}} - microblog</title>
    {% else %}
    <title>microblog</title>
    {% endif %}

    <style>
        hr {color:sienna;}
        body {background-color: #f0fafb;}
    </style>
    <style>
        *{margin:0;padding:0;}
        #header{
            height:50px;
            background:#000000;
            margin-bottom:10px;
        }
        #nav{
            width:100%;
            margin:0 auto;
            margin-bottom:10px;
        }
        #nav ul{
            list-style:none;
            background:#009900;
            overflow:hidden;
        }
        #nav li{
            float:left;
        }
        #nav li a{
            display:block;
            color:black;
            width:104px;
            height:30px;
            line-height:30px;
            text-decoration:none;
            text-align:center;
        }
        #nav .home{
            width:128px;
        }
        #nav li a:hover{
            color:white;
            background:green;
        }
        #side_tag {
            width:20%;
            margin-left: 100px;
            margin-bottom:400px;
            margin-top:100px;
            margin-right: 80px;
        }
        #side_tag nav {
            overflow:hidden;width:100%;
        }
        #side_tag ul {
            list-style:none;
            background:white;
            overflow:hidden;
            margin-top:0px
        }
        #side_tag li {
            width:33.333%;
            float:left;
            text-align:center;
            margin:0;
            padding:0;
        }
        #main{
            width:100%;
            position:relative;
        }
        #main .main-left{
            width:13%;
            height:200px;
            background:white;
            float:left;
            margin:0 50px 0 100px;
            border-bottom-color:#000
            border-right-color:#000
            margin-bottom:10px
        }
        #main .main-center{
            width:50%;
            height:200px;
            background:white;
            margin:0 200px 0 300px;
            margin-bottom:10px
            float:left;
        }
        #main .main-right{
            width:20%;
            height:200px;
            background:white;
            position:absolute;
            right:0;
            float: right;
            top:0;
        }

    </style>
</head>
<div>
<div id="header" style="tex">
    <font color="white" size="6" style="padding-left:50px "> RUNNINGBEAN</font>
    {% if g.user.is_authenticated %}
        <a href="/user/{{g.user.username}}" style="float: right;padding-right: 50px;color: #f0fafb">{{g.user.username}}</a>
    {% else %}
        <a href="/login" style="float: right;padding-right: 50px;color: #f0fafb">登陆</a>
    {% endif %}
</div>

<div id="nav">
    <ul>
        <li><a  class="home" href="/">首页</a></li>
        <li><a href="#">留言</a></li>
        <li><a href="/user/lixueliang">关于</a></li>
        {% if g.user.is_authenticated %}
        <li><a href="{{ url_for('addpost') }}">添加文章</a></li>
        <li><a href="{{ url_for('editpost',title=title) }}">修改文章</a></li>
        <li><a href="{{ url_for('delpost',title=title) }}">删除文章</a></li>
        <li><a href="{{ url_for('logout') }}">退出</a></li>
        {% endif %}
    </ul>
</div>

<div>
    <form action="{{ url_for("search") }}" method="post" name="search">
    {{ form_search.csrf_token }}
    <div>
        <br>{{ form_search.search(size=80) }}<br>
        <p><input type="submit" value="搜索"></p>
</div>
</form>
</div>


<hr>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
    {% for message in messages %}
    <li>{{ message }} </li>
    {% endfor %}
</ul>
{% endif %}
{% endwith %}

{% block content %}{% endblock %}
</body>
</html>